<!-- application/layouts/scripts/layout.phtml -->
<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>SHM Tests de nivel</title>
  <?php echo $this->headLink()->appendStylesheet($this->baseUrl().'/public/css/global.css') ?>
  <?php echo $this->headLink()->appendStylesheet($this->baseUrl().'/public/css/style.css') ?>
  <?php echo $this->headLink()->appendStylesheet($this->baseUrl().'/public/jquery-ui/css/custom-theme/jquery-ui-1.8.4.custom.css') ?>
  <?php echo $this->headScript()->appendFile($this->baseUrl().'/public/jquery-ui/js/jquery-1.4.2.min.js', 'text/javascript'); ?>
  <?php echo $this->headScript()->appendFile($this->baseUrl().'/public/jquery-ui/js/jquery-ui-1.8.4.custom.min.js', 'text/javascript'); ?>
  <?php echo $this->headScript()->appendFile($this->baseUrl().'/public/js/app.js', 'text/javascript'); ?>
</head>
<body>

<script type="text/javascript">
	$(function() {
    $("button, a.toolbar, input:submit").button();
	});
	</script>



<div id="dialog-confirm" title="Are you sure?" style="display: none;">
    <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>These item will be permanently deleted and cannot be recovered. Are you sure?
</div>

<div id="dialog-error" title="" style="display: none;">
    
</div>


<div id="toolbar-button" class="ui-widget-header ui-corner-bottom">

    
    <?php
        $authNamespace = new Zend_Session_Namespace('Zend_Auth');
        if(isset($authNamespace->user) && $authNamespace->userRole == 'admin') {
            echo '<a href="<?php echo $this->baseUrl() ?>" class="toolbar">Dashboard</a>';
            //echo '<a href="'.$this->baseUrl().'/question" class="toolbar">Questions</a>';
            echo '<a href="'.$this->baseUrl().'/level" class="toolbar">Levels</a>';
            echo '<a href="'.$this->baseUrl().'/test" class="toolbar">Tests</a>';
            echo '<a href="'.$this->baseUrl().'/questionnaire" class="toolbar">Questionnaires</a>';
            echo '<a href="'.$this->baseUrl().'/user" class="toolbar">Users</a>';
        }

        if(isset($authNamespace->user) && $authNamespace->userRole == 'user') {
            echo '<a href="'.$this->baseUrl().'/user-tests/" class="toolbar">Tests</a>';
        }
    
        if(isset($authNamespace->user)) {
            echo '<div id="user-profile">';
            echo '<div id="user-name">Logged as '.$authNamespace->user.'</div>';
            echo '<div class="ui-state-default ui-corner-all" title="User" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-person"></span></div>';
            echo '<a href="'.$this->baseUrl().'/auth/logout"><div class="ui-state-default ui-corner-all" title="Logout" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-power"></span></div></a>';
            echo '</div>';
        } /*else {
            echo '<div id="user-profile" class="user-profile-login">';
            echo '<a href="'.$this->baseUrl().'/auth/login"><div class="ui-state-default ui-corner-all" title="Login" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-person"></span></div></a>';
            echo '<form action="'.$this->baseUrl().'/auth/login" method="post">';
            echo '<div style="float: left;">';
            echo '<input id="username" type="text" size="10" name="username" style="margin-right: 3px;"/>';
            echo '</div>';
            echo '<div style="float: left;">';
            
            echo '<div class="ui-state-default ui-corner-all" title="Password" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-key"></span></div>';
            echo '<input id="password" type="password" size="10" name="password" />';
            echo '</div>';
            echo '<div style="float: left;">';
            echo '&nbsp;';
            echo '<input type="submit" value="Login" />';
            echo '</div>';
            echo '</form>';
            echo '</div>';
        }*/
    ?>
</div>
<?php
    if ($this->message) { ?>
    <br />
        <div class="ui-widget">
            <div class="ui-state-error ui-corner-all" style="padding: 0pt 0.7em;">
                <p>
                    <span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span>
                    <strong>Alert:</strong>
                    <? echo $this->message;  ?>
                </p>
            </div>
        </div>
        
    <?php
    }
    ?>
<div class="demo">


<div id="content">

<?php echo $this->layout()->content ?>
 
</div>
</div>

</body>
</html>

